---------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\user\Documents\work/DNB_survey_consumption/ConGrowth/Replication/Programs/IV/Cons_Unc_IV_boot1000_spt
> ri.log
  log type:  text
 opened on:  14 Dec 2018, 11:41:58
Results for outcome w005_hpconch_nyr, treatm. w005_hmsptri_sqcgr, IV , spec.1
Conventional IV regression
(running ivregress on estimation sample)

Bootstrap replications (1000)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500
..................................................   550
..................................................   600
..................................................   650
..................................................   700
..................................................   750
..................................................   800
..................................................   850
..................................................   900
..................................................   950
..................................................  1000

Instrumental variables (LIML) regression               Number of obs =    2791
                                                       Wald chi2(11) =   23.37
                                                       Prob > chi2   =  0.0157
                                                       R-squared     =  0.1607
                                                       Root MSE      =  .08189

                                    (Replications based on 1495 clusters in nohhold)
------------------------------------------------------------------------------------
                   |   Observed   Bootstrap                         Normal-based
  w005_hpconch_nyr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
w005_hmsptri_sqcgr |   .8369765   .4631914     1.81   0.071     -.070862    1.744815
               age |  -.0000131    .000123    -0.11   0.915    -.0002541    .0002279
               fem |  -.0001957   .0038511    -0.05   0.959    -.0077436    .0073523
            dwave2 |  -.0047368   .0038824    -1.22   0.222    -.0123461    .0028725
            dwave3 |   .0063963   .0034839     1.84   0.066    -.0004321    .0132247
             dreg2 |   -.000936   .0058012    -0.16   0.872    -.0123062    .0104341
             dreg3 |  -.0052785    .007521    -0.70   0.483    -.0200193    .0094624
             dreg4 |    .004121   .0059569     0.69   0.489    -.0075544    .0157964
             dreg5 |  -.0051214    .006442    -0.80   0.427    -.0177475    .0075047
            hhsize |   .0011691   .0018808     0.62   0.534    -.0025173    .0048555
            couple |  -.0033901   .0055918    -0.61   0.544    -.0143498    .0075696
             _cons |   .0023343   .0127302     0.18   0.855    -.0226164    .0272849
------------------------------------------------------------------------------------
Instrumented:  w005_hmsptri_sqcgr
Instruments:   age fem dwave2 dwave3 dreg2 dreg3 dreg4 dreg5 hhsize couple
               w005_hsdsptri_incgr
Anderson-Rubin test of significance

Note: The bootstrap usually performs best when the confidence level (here, 95%)
      times the number of replications plus 1 (1000+1=1001) is an integer.
..........................

Wild bootstrap, null imposed, 1000 replications, Anderson-Rubin Wald test, bootstrap clustering by nohhold, Rademacher weig
> hts:
  w005_hmsptri_sqcgr

                                           z =     4.7925
                                    Prob>|z| =     0.0160

95% confidence set for null hypothesis expression: [.2794, 1.225]
F-test first stage
(running regress on estimation sample)

Bootstrap replications (1000)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500
..................................................   550
..................................................   600
..................................................   650
..................................................   700
..................................................   750
..................................................   800
..................................................   850
..................................................   900
..................................................   950
..................................................  1000

Linear regression                               Number of obs      =      2791
                                                Replications       =      1000
                                                Wald chi2(11)      =     17.26
                                                Prob > chi2        =    0.1005
                                                R-squared          =    0.0248
                                                Adj R-squared      =    0.0210
                                                Root MSE           =    0.0662

                                     (Replications based on 1495 clusters in nohhold)
-------------------------------------------------------------------------------------
                    |   Observed   Bootstrap                         Normal-based
 w005_hmsptri_sqcgr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
w005_hsdsptri_incgr |   .2393283   .1201639     1.99   0.046     .0038115    .4748451
                age |   -.000016   .0000731    -0.22   0.827    -.0001594    .0001274
                fem |   .0002094   .0031212     0.07   0.947     -.005908    .0063269
             dwave2 |  -.0002031    .002683    -0.08   0.940    -.0054616    .0050555
             dwave3 |   .0010093   .0029136     0.35   0.729    -.0047012    .0067199
              dreg2 |  -.0027548   .0043178    -0.64   0.523    -.0112176    .0057079
              dreg3 |  -.0073835   .0045195    -1.63   0.102    -.0162417    .0014746
              dreg4 |  -.0030456   .0044993    -0.68   0.498    -.0118641    .0057729
              dreg5 |  -.0025918    .005294    -0.49   0.624    -.0129679    .0077843
             hhsize |     .00184   .0015033     1.22   0.221    -.0011064    .0047864
             couple |  -.0070903   .0041765    -1.70   0.090    -.0152761    .0010956
              _cons |    .011969   .0081566     1.47   0.142    -.0040177    .0279557
-------------------------------------------------------------------------------------
Hausman test for endogeneity
(running regress on estimation sample)

Bootstrap replications (1000)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500
..................................................   550
..................................................   600
..................................................   650
..................................................   700
..................................................   750
..................................................   800
..................................................   850
..................................................   900
..................................................   950
..................................................  1000

Linear regression                               Number of obs      =      2791
                                                Replications       =      1000
                                                Wald chi2(12)      =     49.64
                                                Prob > chi2        =    0.0000
                                                R-squared          =    0.1976
                                                Adj R-squared      =    0.1941
                                                Root MSE           =    0.0803

                                    (Replications based on 1495 clusters in nohhold)
------------------------------------------------------------------------------------
                   |   Observed   Bootstrap                         Normal-based
  w005_hpconch_nyr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
w005_hmsptri_sqcgr |   .8369765   .2632534     3.18   0.001     .3210093    1.352944
               age |  -.0000131   .0001146    -0.11   0.909    -.0002376    .0002115
               fem |  -.0001957   .0034614    -0.06   0.955    -.0069799    .0065886
            dwave2 |  -.0047368    .003366    -1.41   0.159     -.011334    .0018604
            dwave3 |   .0063963   .0033153     1.93   0.054    -.0001016    .0128942
             dreg2 |   -.000936   .0055291    -0.17   0.866    -.0117729    .0099008
             dreg3 |  -.0052785   .0064524    -0.82   0.413     -.017925    .0073681
             dreg4 |    .004121   .0057658     0.71   0.475    -.0071797    .0154216
             dreg5 |  -.0051214    .006046    -0.85   0.397    -.0169714    .0067285
            hhsize |   .0011691    .001788     0.65   0.513    -.0023352    .0046734
            couple |  -.0033901   .0050448    -0.67   0.502    -.0132777    .0064975
             resid |  -.2599548   .2628211    -0.99   0.323    -.7750747    .2551651
             _cons |   .0023343   .0104393     0.22   0.823    -.0181264     .022795
------------------------------------------------------------------------------------

. *set trace on
.          
. global l3 ${treat} ${l2}         

. local nl3: word count ${l3} _cons         

. assert `nl3' == ${nc}         

. 
. *Saving matrix of regression results as a text file            
. matrix A_sp${k}_t${tv}_o${on}=J(${nc${nsp}}+2+${nb}+${naddsc}+1,${ncol}+1,.)            

.          
. *Putting in the coefficients and std errors of the estimation        
. local nn = ${nc${nsp}}+2      

. forvalues m=1/`nn' {         
  2. 
.       if `m'<=${nc}-1 {      
  3.          local l=`m'      
  4.       }      
  5.       else if `m'==`nn' {      
  6.          local l=${nc}      
  7.       }      
  8.          
.       if (`m'<=${nc}-1 | `m'==`nn') {      
  9.          matrix A_sp${k}_t${tv}_o${on}[`m',1] = olco[1,`l']         
 10.          matrix A_sp${k}_t${tv}_o${on}[`m',2] = sqrt(olvar[`l',`l'])         
 11.          matrix A_sp${k}_t${tv}_o${on}[`m',3] = ///      
>             A_sp${k}_t${tv}_o${on}[`m',1]/A_sp${k}_t${tv}_o${on}[`m',2]         
 12.          matrix A_sp${k}_t${tv}_o${on}[`m',4] = ///      
>             2*ttail(nobs - ${nc},abs(A_sp${k}_t${tv}_o${on}[`m',3]))         
 13.          matrix A_sp${k}_t${tv}_o${on}[`m',5] = ///      
>             A_sp${k}_t${tv}_o${on}[`m',1] - invttail(nobs - ${nc},sigl/2)*A_sp${k}_t${tv}_o${on}[`m',2]         
 14.          matrix A_sp${k}_t${tv}_o${on}[`m',6] = ///      
>             A_sp${k}_t${tv}_o${on}[`m',1] + invttail(nobs - ${nc},sigl/2)*A_sp${k}_t${tv}_o${on}[`m',2]         
 15.       }      
 16. }         

. 
. *Adding various additional estimates      
. forvalues ad=1/$naddsc {      
  2.    local adv: word `ad' of ${addsc}      
  3.    matrix A_sp${k}_t${tv}_o${on}[${nc${nsp}}+2+${nb}+`ad',1]=`adv'        
  4. }      

. *Labels of matrix of regression output   
. *Column labels       
. local cnn ""         

. foreach nm in $col {         
  2.    local cnn `cnn' `nm'_${mth}_sp${k}         
  3. }         

.          
. matrix colnames A_sp${k}_t${tv}_o${on} = `cnn' blank             

.          
. *Row labels         
. local bl 

. forvalues bbl=1/$nb {         
  2.    local bl `bl' blank         
  3. }

. 
. local rn ${treat} ${spf${nsp}} _cons `bl' ${addsc}

. local rn2 ""

. foreach var in `rn' {
  2.    local rn2 `rn2' ${ol}_`var'
  3. }

. matrix rownames A_sp${k}_t${tv}_o${on} = `rn2' blank         

.          
. 
. 
end of do-file
